<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <button onclick="add1()">增</button>
    <button onclick="">删</button>
    <button onclick="update1()">改</button>
    <button onclick="">查</button>
    <a href="http://127.0.0.1:5500/03%E6%B5%8B%E8%AF%95%E8%AE%BF%E9%97%AEsessionStorage.html">03页面</a>
    <script>
        function add1(){
            window.sessionStorage.setItem('myname','张三66');
            window.sessionStorage.setItem('age',18);
            window.sessionStorage.setItem('person',{age:18});
            window.sessionStorage.setItem('arr',[1,2,3,4]);
        }


        function update1(){
            window.sessionStorage.setItem('person',JSON.stringify({age:18}));
            window.sessionStorage.setItem('arr',JSON.stringify([1,2,3,4]));
        }
    </script>
</body>
</html>